package com.mark.controller.portal;

import com.mark.common.ServerResponse;
import com.mark.service.IHeadLineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by Choisaaaa on 2018/5/15.
 * 头条信息的前端调用：获取三条头条信息用于轮播图展示
 */

@Controller
@RequestMapping("/headLine/")
public class HeadLineController {
    @Autowired
    private IHeadLineService iHeadLineService;

    //1.获取公告信息列表。调用时不用传参使用默认值即可
    @RequestMapping(value="list.do" , method = RequestMethod.GET)
    @ResponseBody
    public ServerResponse getUserList(@RequestParam(value = "pageNum",defaultValue = "1") int pageNum,
                                      @RequestParam(value = "pageSize",defaultValue = "3") int pageSize){
        return iHeadLineService.portalGetHeadLineList(pageNum,pageSize);
    }
}
